package com.spring.sample.controller;


import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import com.spring.sample.service.ICompareService;


@Controller
@RequestMapping("/*")
public class CompareController {
	
	final Logger logger = LoggerFactory.getLogger(this.getClass());
	@Autowired ICompareService compareService;
	
	@RequestMapping("/compare")
	public void  HelloPattern(@RequestParam(defaultValue="") String mbrNo,@RequestParam(defaultValue="")String userCompareSeq,@ModelAttribute("model") HashMap<String,Object> model) throws IOException{
		logger.info("compare 수행 ");
		List<Map<String, Object>> list = compareService.compare(mbrNo,userCompareSeq);
		logger.info("test : {}",list.get(0).get("test"));
		model.put("resultList", list);
	}
}